package com.xtc.ql00045.frame1.view;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.lzy.okgo.model.HttpParams;
import com.xtc.ql00045.frame1.R;
import com.xtc.ql00045.frame1.base.BaseActivity;
import com.xtc.ql00045.frame1.bean.TestBean;
import com.xtc.ql00045.frame1.contract.TestContract;
import com.xtc.ql00045.frame1.presenter.TestPresenter;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class MainLoginActivity extends BaseActivity implements TestContract.View{
    @BindView(R.id.title_text)
    TextView titleText;
    @BindView(R.id.edit_email)
    EditText editEmail;
    @BindView(R.id.edit_pwd)
    EditText editPwd;
    @BindView(R.id.tv_txt)
    TextView tvTxt;

    TestContract.Presenter presenter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_userlogin);
        ButterKnife.bind(this);
        presenter = new TestPresenter(this);
    }


    @OnClick({R.id.btn_back, R.id.forgot_pwd, R.id.comfirm_login})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_back:
                removeActivity();
                break;
            case R.id.forgot_pwd:
                break;
            case R.id.comfirm_login:
//                //测试MVP框架用
//                HttpParams httpParams = new HttpParams();
//                httpParams.put("v","1.0");
//                httpParams.put("month","10");
//                httpParams.put("day","8");
//                httpParams.put("key","fbcfc4732e45052b5a225c0fac0ae94b");
//                presenter.send2Model(httpParams);


                break;
        }
    }

    @Override
    public void dataCallBack(TestBean bean) {
        tvTxt.setText(bean.getReason());
        List<TestBean.ResultBean> list = bean.getResult();

    }
}
